home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-11 / exoapi.zip / INT2F.ASM < prev    next >
Assembly Source File  |  1993-06-05  |  2KB  |  77 lines

  1. .MODEL large, c
  2. .286
  3. ; ***********************************************************************
  4. ; *                                                                     *
  5. ; * MASM 6.x example of calling the multiplex interrupt function 1216h. *
  6. ; *                                                                     *
  7. ; * This code is released to the public domain.                         *
  8. ; *                                                                     *
  9. ; ***********************************************************************
  10.  
  11.  
  12. ; type definitions and defines
  13. FARPTR                    TYPEDEF                FAR PTR            ; far ptr to anything
  14. TRUE                        EQU                    1
  15. FALSE                        EQU                    0
  16.  
  17.  
  18. ; DOS16/M register structure for ExoRMInterrupt()
  19. EXOREGS STRUCT
  20. wDS                        WORD                    ?
  21. wES                        WORD                    ?
  22. wDI                        WORD                    ?
  23. wSI                        WORD                    ?
  24. wBP                        WORD                    ?
  25. wSP                        WORD                    ?
  26. wBX                        WORD                    ?
  27. wDX                        WORD                    ?
  28. wCX                        WORD                    ?
  29. wAX                        WORD                    ?
  30. EXOREGS ENDS
  31.  
  32.  
  33.  
  34. ;**********************************************************************
  35. ; code
  36. ;**********************************************************************
  37. .CODE
  38.  
  39. ; DOS/16M external function prototypes
  40. ExoRMInterrupt PROTO FAR C wInt:WORD, InRegs:FARPTR, OutRegs:FARPTR
  41.  
  42.  
  43. handles PROC FAR C _wNumHandles:WORD
  44.  
  45.     LOCAL _Regs:EXOREGS
  46.  
  47.  
  48.     ; set up registers
  49.     mov _Regs.wAX, 1216h
  50.     mov ax, _wNumHandles
  51.     mov _Regs.wBX, ax
  52.  
  53.     ; call the real mode interrupt
  54.     INVOKE ExoRMInterrupt, 2Fh, ADDR _Regs, ADDR _Regs
  55.  
  56.     ; get the flags that were returned in ax
  57.     push ax
  58.     popf
  59.  
  60.     ; see if _wNumHandles was greater than FILES setting
  61.     .IF (CARRY?)
  62.         ; yup, it was greater
  63.         mov ax, FALSE
  64.     .ELSE
  65.         ; nope, FILES >= _wNumHandles
  66.         mov ax, TRUE
  67.     .ENDIF
  68.  
  69.     ; return with ax set to TRUE or FALSE
  70.     ret
  71.  
  72. handles ENDP
  73.  
  74.  
  75. END
  76.  
  77.